Skip to content

Conversation

@DaveCTurner
Copy link
Contributor

Backports the following commits to 8.19:

No need to do this via an allocation-heavy `Stream`, we can just put the
objects straight into an array, sort them in-place, and keep hold of the
array to avoid having to allocate anything on the next iteration.

Also slims down `BY_DESCENDING_SHARD_ID`: it's always sorting the same
index so we don't need to look at `ShardId#index` in the comparison, nor
do we really need multiple layers of vtable lookups, we can just compare
the shard IDs directly.

Relates elastic#128021
@DaveCTurner DaveCTurner added :Distributed Coordination/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) >enhancement auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport Team:Distributed Coordination Meta label for Distributed Coordination team labels May 19, 2025
@elasticsearchmachine elasticsearchmachine merged commit abba062 into elastic:8.19 May 19, 2025
15 checks passed
@DaveCTurner DaveCTurner deleted the backport/8.19/pr-128063 branch May 19, 2025 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport :Distributed Coordination/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) >enhancement Team:Distributed Coordination Meta label for Distributed Coordination team v8.19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants